package com.hangzhou.xyj.ui.adapter.viewholder;

import android.support.v7.widget.RecyclerView;
import android.view.View;

import com.hangzhou.xyj.R;
import com.hangzhou.xyj.model.CommentModel;
import com.hangzhou.xyj.ui.widget.CircleImageView;
import com.hangzhou.xyj.ui.widget.views.MyTextView;

/**
 * Created by yaohuix on 2016/3/21  15:49
 * <p/>
 * 说明：评论ViewHolder
 */
public class CommentViewHolder extends RecyclerView.ViewHolder {
    public CircleImageView mCivHeadImg;//头像
    MyTextView mTvName;//昵称
    MyTextView mTvTime;//时间
    View view;//下划线
    MyTextView mTvContent;//评论内容


    public CommentViewHolder(View itemView) {
        super(itemView);
        mCivHeadImg = (CircleImageView) itemView.findViewById(R.id.civ_header);//头像
        mTvName = (MyTextView) itemView.findViewById(R.id.tv_item_username);//昵称
        mTvTime = (MyTextView) itemView.findViewById(R.id.tv_item_time);//时间
        mTvContent = (MyTextView) itemView.findViewById(R.id.mtv_my_comment);//评论内容
        view = itemView.findViewById(R.id.v_underline);
    }

    public void setData(CommentModel data) {
        mCivHeadImg.displayImage(data.getUserHead());
        mTvName.setText(data.getUserName());
        mTvTime.setText(data.getCommentTime());
        mTvContent.setText(data.getContent());
    }
}
